﻿using B.S.Sterilizationcenter.ErrorCode;
using B.S.Sterilizationcenter.Read.API.Appliaction.Commends.zmc.Instrumentkit;
using B.S.Sterilizationcenter.Read.API.Dto;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Sterilizationcenter.Read.API.Controllers.ZMC.Instrumentkit
{
    [Route("api/[controller]/[Action]")]
    [ApiController]
    public class InstrumentkitController : ControllerBase
    {
        private readonly IMediator mediator;

        public InstrumentkitController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 查询器械包数据
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<ApiResult<List<InstrumentkitApparaDtos>>> QueryInstrumentkit([FromQuery]QueryInstrumentkitCommends request, CancellationToken cancellationToken)
        {
            try
            {
                return await mediator.Send(request, cancellationToken);

            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
